#ifndef CARD_H
#define CARD_H

#include <QString>

class Card
{
private:
    int id;
    QString cardNum  = QString("%1").arg("000000"); // six digital card id
    QString username;
    QString userPic;
    int     taken  = -1;    // the position has parked
    bool    status = false; // true is parked, false is unparked
    int     leaveTime; // seconds
public:
    Card();
    Card(QString cardNum);
    Card(int i, QString num,QString name, QString pic, int t, bool s);
    QString getCardNum();
    void    setCardNum(QString cardNum);
    bool    getStatus();
    void    setStatus(bool status);
    int     getTaken();
    void    setTaken(int taken);
    static Card * randomGenerate();
    /**
     * @brief operator =
     * @param card
     * @return
     */
    Card    operator=(const Card card);

    int getId() const;
    QString getUsername() const;
    QString getUserPic() const;
    int getLeaveTime() const;
    void setLeaveTime(int value);
    static bool compLeaveTime(Card a, Card b);
};

#endif // CARD_H
